<%@ page pageEncoding='UTF-8'%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:set var="contextPath" value="#request.get('javax.servlet.forward.context_path')" scope="request" />
<!DOCTYPE html>
<head>
    <title>Prescription Details</title>
    <%-- header --%>
    <jsp:include page="/WEB-INF/content/common/Header.jsp" flush="true"/>
</head>
<body class="metro">
	<%-- tob-bar --%>
    <jsp:include page="/WEB-INF/content/common/TopBar.jsp" flush="true"/>
       	
	<div id="main-container" class="body-wrapper">
        <%-- tob-container --%>
    	<jsp:include page="/WEB-INF/content/common/TopContainer.jsp" flush="true"/>
        
    	<div id="body-container">
        	<div id="prescription-registration-form-container" class="form-container">
        		<%-- header-container --%>
	       		<s:set var="mode" value="'details'"/>
	   			<jsp:include page="/WEB-INF/content/prescription/PrescriptionHeaderContainer.jsp" flush="true"/>
	   			
               	<fieldset>
               		<%-- prescription-info-container --%>
               		<div class="patient-info-container">
	                   	<jsp:include page="/WEB-INF/content/prescription/PrescriptionPatientDetails.jsp" flush="true"/>
                   	</div>
                   	
                   	<s:if test="%{guiPrescription.existPrevPrescription}">
                   		<div id="history-info-container">
                    		<legend>History of the illness</legend>
	                    	<p class="subheader-secondary">
								Presenting Complaints (P/C)
								<span class="subheader-secondary opt1-4">(${guiPrescription.prevPrescription.dateString})</span>
							</p>
	                    	<div id="previouslyIdentifiedSymptomList">
		                    	<s:iterator var="prevSyptom" value="%{guiPrescription.prevPrescription.syptomList}" status="stat">
			                    	<div class="identifiedSymptom padding10 border">
			                    		${prevSyptom.name}
			                    	</div>
		                    	</s:iterator>
	                    	</div>
                    	</div>
                   	</s:if>
                   	
                   	<div class="treatment-info-container">
	                   	<legend>Today's Treatment</legend>
	                   	<p class="subheader-secondary">Presenting Complaints (P/C)</p>
	                   	<div id="identifiedSymptomList">
	                    	<s:iterator var="oSyptom" value="%{guiPrescription.syptomList}" status="stat">
			                   	<div class="identifiedSymptom padding10 border">
		                    		${oSyptom.name}
			                   	</div>
	                    	</s:iterator>
	                   	</div>
                   	</div>
                   	<br/>
                   	
                   	<div id="symptom-duration-container">
                   		<p class="subheader-secondary">Duration (Days)</p>
                   		<div>${guiPrescription.symptomDuration}</div>
                   	</div>
                   	<br/>
                   	
                   	<div id="prescription-diagnostic-container">
						<p class="subheader-secondary">Diagnosis Description</p>
                    	<div id="treatmentNoteContainer">${guiPrescription.diagnosticDescription}</div>
					</div>
                   	<br/>
                   	
                   	<div class="medicine-info-container">
	                   	<p class="subheader-secondary">Medicine</p>
	                   	
	                   	<table class="table striped bordered hovered">
	                   		<thead class="medicine-header-container">
	                   			<tr>
	                   				<th>Drug</th>
	                   				<th>Terms Per Day</th>
	                   				<th>No. Of Days</th>
	                   				<th>Get Treatment</th>
	                   				<th>Issue</th>
	                   			</tr>
	                   		</thead>
	                   		<tbody>
	                   			<s:iterator var="oDrugIssue" value="%{guiPrescription.drugIssueList}" status="stat">
	                   			<tr>
	                   				<td>${oDrugIssue.drug.name}</td>
	                   				<td>${oDrugIssue.termsPerDay}</td>
	                   				<td>${oDrugIssue.noOfDays}</td>
	                   				<td>${oDrugIssue.treatmentTime.label}</td>
	                   				<td>
										<label class="input-control checkbox">
											<s:if test="#oDrugIssue.issue">
												<input type="checkbox" disabled="disabled" name="guiPrescription.drugIssueList[${stat.index}].issue" checked="checked"/>
											</s:if>
											<s:else>
												<input type="checkbox" disabled="disabled" name="guiPrescription.drugIssueList[${stat.index}].issue"/>
											</s:else>
											<span class="check"></span>
										</label>
									</td>
	                   			</tr>
	                   			</s:iterator>
	                   		</tbody>
	                   	</table>
					</div>
                   	<div class="comment-info-container">
	                   	<p class="subheader-secondary">Comment</p>
	                   	<div>
	                   		<blockquote>
	                   			<p>${guiPrescription.comment}</p>
	                   		</blockquote>
	                   	</div>
                   	</div>
                   	<br/>
                   	<div class="treatment-date-container">
	                   	<legend>Treatment Date</legend>
	                   	<div class="subheader-secondary">${guiPrescription.dateString}</div>
                   	</div>
                   	<br/>
					<div class="form-button-container">
                        <a href="${contextPath}/prescription/edit?id=${guiPrescription.prescriptionId}">
                            <div class="form-button tile half-vertical subheader-secondary bg-cobalt fg-white">
                                edit <i class="icon-pencil on-right smaller"></i>
                            </div>
                        </a>
                        <a id="btn-cancel" href="${contextPath}">
                            <div class="form-button tile half-vertical subheader-secondary bg-cyan fg-white">
                                cancel <i class="icon-cancel-2 on-right smaller"></i>
                            </div>
                        </a>                            
	                </div>
       			</fieldset>
    		</div>    
    	</div>
        
        <%-- bottom-container --%>
    	<jsp:include page="/WEB-INF/content/common/BottomContainer.jsp" flush="true"/>
        
	</div>
    
    <%-- footer-container --%>
    <jsp:include page="/WEB-INF/content/common/FooterContainer.jsp" flush="true"/>
    
</body>
</html>